/**
  ************************************* Copyright ******************************
  * FileName   : oled.h
  * Version    : v1.0
  * Author     : yychao
  * Date       : 2023-01-18
  * Description:
  * Function List:
  	1. ....
  	   <version>:
  <modify staff>:
  		  <data>:
   <description>:
  	2. ...
  ******************************************************************************
 */

#ifndef __OLED_H_
#define __OLED_H_
#include "main.h"
#include "font.h"

#define OLED_WIDTH  128//OLED width
#define OLED_HEIGHT 32 //OLED height

#define SSD1306_IIC_CMD_MASK	(0<<6)
#define SSD1306_IIC_DAT_MASK	(1<<6)
#define SSD1306_SLAVE_ADDR		0x78
#define SSD1306_IIC_READ		0x1
#define SSD1306_IIC_WRITE		0x0

#define OLED_CMD  0
#define OLED_DATA 1

void oled_init(void);

void LCD_RAM_INI(void);
void LCD_POINT(uint8_t x, uint8_t y, uint8_t dis);
void LCD_CLEAR(uint8_t dis);
void LCD_ADDRESS(uint8_t page, uint8_t column);
void LCD_UPDATE(void);

void LCD_ShowStr(uint16_t x, uint16_t y, uint8_t *str, FONT_SIZE size, REV reverse);
void LCD_ShowChar(uint16_t x, uint16_t y, uint8_t num, FONT_SIZE size, REV reverse);
void LCD_LINE(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void LCD_TRIANGEL(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
                  uint16_t x2, uint16_t y2);
void LCD_RECTANGLE(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void LCD_CIRCLE(int xc, int yc, int r);

#endif


